package com.zhoust.fastdome.aspect;

import com.zhoust.fastdome.business.dao.UserMapper;
import com.zhoust.fastdome.business.service.UserService;
import com.zhoust.fastdome.common.CommonResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhoust
 */
@Slf4j
@RestController
public class TestForAspectDomeController {

    @GetMapping("/testCatch")
    public CommonResponse testCatch(String id){

        log.info("controller中正常方法");

        return CommonResponse.succeed("成功");

    }

    @GetMapping("/testCatchThrow")
    public CommonResponse testCatchThrow(String id){

        log.info("controller中抛异常！");
        int i =5/0;

        return CommonResponse.succeed("成功");

    }

}
